<?php

namespace App\Admin\Controllers;

use Encore\Admin\Form;
use Encore\Admin\Grid;

class SuperUsersController extends CommonUsersController
{
    protected $title = '会员总管列表';

    protected function getType()
    {
	    return 'super';
    }

    protected function customedGrid(Grid $grid)
    {
	    // TODO: Implement customedGrid() method.
    }

    protected function customedDetail($id)
    {
	    // TODO: Implement customedDetail() method.
    }

    protected function customedForm(Form $form)
    {
	    $form->divider('超级管理员操作项');

	    $form->display('grade', '会员身份');
	    $form->display('parent_id', '父级ID');
	    $form->text('name', '昵称')->rules('required|unique:users,name,{{id}}');
	    $form->text('phone', '手机')->rules('required|unique:users,phone,{{id}}');
        if (! app()->environment('production')) {
            $form->currency('gold_coins', '金店账户')->symbol('￥');
            $form->currency('gold_beans', '金店金豆')->symbol('￥');
        }
        $form->radio('is_gold_intern', '见习师')->options(config('site.bool'));
        $form->radio('is_gold_master', '炼金师')->options(config('site.bool'));
    }
}
